﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VoteResult.aspx.cs" Inherits="Meeting.Web.Admin.MeetingAfter.VoteResult" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../../Css/main.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/cupertino/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/icon.css" />
    <script type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../Scripts/locale/easyui-lang-zh_CN.js"></script>
    <script src="../../Scripts/common.js" type="text/javascript"></script>
    <style type="text/css">
        table
        {
            border: 1px solid #B1CDE3;
            padding: 0;
            margin: 0 auto;
            border-collapse: collapse;
        }
        
        td
        {
            border: 1px solid #B1CDE3;
            background: #fff;
            font-size: 12px;
            padding: 3px 3px 3px 8px;
            color: #4f6b72;
            
        }
        .tb1
        {
            border: 1px solid #B1CDE3;
            padding: 0;
            margin: 0 auto;
            border-collapse: collapse;
        }
        .tb1 td
        {
             border: 1px solid #B1CDE3;
            background: #fff;
            font-size: 12px;
            padding: 3px 3px 3px 8px;
            color: #4f6b72;
            width:150px;
        }
        .officeHeader td
        {
            background-color: #1267A0;
            font-size: 16px;
            color: White;
        }
        .officeInterval td
        {
            background-color: #51B2F6;
            font-size: 14px;
            color:Black;
        }
        .officeData td
        {
            font-size: 14px;
            font-weight:bold; 
           
        }
        .tablel th{border:solid #B1CDE3;border-width:0 1px 1px 0;padding:2px;}
.tablel td {border:solid #B1CDE3;border-width:0 0px 1px 0;padding:2px;}
    </style>
    <script type="text/javascript">
       
        $(function () {
            var id = request("Id");
            var meetingId = request("MeetingId");
            var category = request("Category");
            $.post("VoteStatisticsOperation.ashx?method=GetVoteResult", { Id: id, MeetingId: meetingId, Category: category }, function (data) {
                if (data.success == true) {
                    var html = "";
                    if (category != "4") //普通投票
                    {
                        html = "<table class=\"tb1\"><tr class=\"officeHeader\"><td>选项</td><td>投票人数</td><td>所占比例</td></tr>"
                        for (i = 0; i < data.ResponseData.length; i++) {
                            html += "<tr><td>" + data.ResponseData[i].Value + "</td>";
                            html += "<td>" + data.ResponseData[i].SelectedCount + "</td>";
                            html += "<td>" + data.ResponseData[i].SelectedPer + "</td></tr>";
                        }
                        html += "</table>";
                    } else { //分局打分
                        var tempOffice = "";
                        html = "<table class=\"tablel\" width=\"600px\"><tr class=\"officeHeader\"><td></td><td  width=\"200px\">打分项目</td><td>打分人数</td><td>最低分</td><td>最高分</td><td>平均分</td></tr>"
                        for (i = 0; i < data.ResponseData.length; i++) {
                            var dr = data.ResponseData[i];
                            if (tempOffice != dr.SubOfficeName) { //写入行
                                tempOffice = dr.SubOfficeName;
                                html += "<tr class=\"officeInterval\"><td>" + tempOffice + "</td><td  ></td><td></td><td></td><td></td><td></td></tr>";
                            }
                            html += "<tr class=\"officeData\"><td></td><td  >" + dr.ItemName + "</td>";
                            html += "<td>" + dr.PeopleNumber + "</td><td>" + dr.ScoreMin + "</td><td>" + dr.ScoreMax;
                            html += "</td><td>" + dr.ScoreAvg + "</td></tr>";
                        }
                        html += "</table>";
                    }
                    $("#result").html(html);
                } else {
                    $.messager.alert("提示", data.Message);
                }
            });
        });        
    </script>
    <%--<a href="VoteResult.aspx">VoteResult.aspx</a>--%>
</head>
<body>
    <form id="form1" runat="server">
    <div id="result">
    </div>
    </form>
</body>
</html>
